<?php

require_once "../../vendor/autoload.php";
//use Workerman\Worker;

use GatewayWorker\Gateway;

// 指定websocket协议
$gateway = new Gateway("text://0.0.0.0:9999");
$gateway->name="gateway";
//$gateway->count = 3;
$gateway->lanIp="127.0.0.1";
$gateway->startPort=10000;
$gateway->registerAddress="127.0.0.1:12138";

//心跳检测服务端配置
$gateway->pingInterval = 10;
$gateway->pingNotResponseLimit = 2;
//服务端向客户端发送数据
$gateway->pingData = '{type:ping}';

$gateway->onWorkerStart = function(){
    echo 'gate way start'.PHP_EOL;
};

$gateway->onWorkerStop = function(){
    echo 'gate way stop'.PHP_EOL;
};

//Worker::runAll();
